
from django.urls import converters
#正则判断名字类
class UsernameConverter:
    regex = '[0-9A-Za-z-_]{5,20}'

    def to_python(self, value):
        return str(value)

#正则判断手机号
class MobileConverter:
    regex = '1[3-9]\d{9}'

    def to_python(self, value):
        return str(value)